﻿using Furion;
using Furion.DatabaseAccessor;
using JoyAdmin.Core.Extension;
using JoyAdmin.EntityFramework.Core.DbContexts;
using Microsoft.Extensions.DependencyInjection;

namespace JoyAdmin.EntityFramework.Core
{
    public class Startup : AppStartup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDatabaseAccessor(options =>
            {
                options.CustomizeMultiTenants();
                options.AddDbPool<MySqlDbContext, MySqlDbContextLocator>(DbProvider.MySql);
                options.AddDbPool<DefaultDbContext>(DbProvider.SqlServer);
            }, "JoyAdmin.Database.Migrations");
        }
    }
}